﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using AbcCorp.BLO;
using AbcCorp.DTO;

namespace AbcCorp.CategoryService
{
    [ServiceContract]
    public interface ICategoryService
    {
        [FaultContract(typeof(Category))]
        [OperationContract]
        IList<Category> GetCategories();

        [FaultContract(typeof(Category))]
        [OperationContract]
        Category GetCategory(int catid);

        [FaultContract(typeof(Category))]
        [OperationContract]
        bool AddCategory(Category newCategory);
    }

    [DataContract]
    public class Category
    {
        /// <summary>
        /// Mã danh mục
        /// </summary>
        [DataMember]
        public int CategoryID { get; set; }

        /// <summary>
        /// Tên danh mục
        /// </summary>
        [DataMember]
        public string CategoryName { get; set; }

    }
}
